import request from '@/utils/request'

export function listRecharge(params) {
  return request({
    url: 'admin/api/user_recharge/list',
    method: 'get',
    params
  })
}

export function refundHistoryList(params) {
  return request({
    url: 'admin/api/user_recharge/history/refundList',
    method: 'get',
    params
  })
}

export function add(data) {
  return request({
    url: 'admin/api/user_recharge/add',
    method: 'post',
    data
  })
}

export function info(id) {
  return request({
    url: 'admin/api/user_recharge/' + id,
    method: 'get'
  })
}

export function success(id) {
  return request({
    url: 'admin/api/user_recharge/success/' + id,
    method: 'post'
  })
}

export function reject(id) {
  return request({
    url: 'admin/api/user_recharge/reject/' + id,
    method: 'post'
  })
}

export function del(data) {
  return request({
    url: 'admin/api/user_recharge/delete',
    method: 'delete',
    data
  })
}

export function edit(data) {
  return request({
    url: 'admin/api/user_recharge/update',
    method: 'put',
    data
  })
}

// 导出
export function exportRecharge(query) {
  return request({
    url: 'admin/api/user_recharge/export',
    method: 'get',
    params: query,
    responseType: 'blob'
  })
}
export function exportRefund(query) {
  return request({
    url: 'admin/api/user_recharge/exportRefund',
    method: 'get',
    params: query,
    responseType: 'blob'
  })
}
